package com.cmower.baeldung.string2;

import java.util.Random;

/**
 * @author 沉默王二，一枚有趣的程序员
 */
public class RandomStringTest1 {
    public static void main(String[] args) {
        int leftLimit = 97; //  'a'
        int rightLimit = 122; //  'z'
        int targetStringLength = 10;
        Random random = new Random();

        String generatedString = random.ints(leftLimit, rightLimit + 1)
                .limit(targetStringLength)
                .collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append)
                .toString();

        System.out.println(generatedString);



    }
}
